import urllib.parse
from enum import Enum

from utils.confUtils import read_db_config

"""
数据库
"""
DB_CON_URI = "mysql+pymysql://" + read_db_config("user") + ":" + urllib.parse.quote(read_db_config("pwd")) + "@" + read_db_config("host") + ":" + read_db_config("port") + "/" + read_db_config("name")


"""
场景
"""
class Scene(Enum):
    UPLOAD = 1
    DOWNLOAD = 2
    CALCULATE = 3
    CACHE = 4

"""
上传类型
"""
class UploadType(Enum):
    BOM = 1
    PRODUCE_SPEED = 2
    PRODUCE_QUEUE = 3
    PARTS = 4
    PARTS_LOAD_DELAY_TIME = 5
    INVENTORY = 6
    SHIPPER = 7
    OPERATION_TIME = 8
    FACTORY_TRANSPORT_TIME = 9
    SUPPLIER_DISTANCE = 10
    SUPPLIER_DURATION = 11
    SUPPLIER = 12
    REQUIRE = 13


"""
下载类型
"""
class DownloadType(Enum):
    REQUIRE = 1
    REQUIRE_SUMMARY = 2
    ORDER_PLAN = 3


"""
计算类型
"""
class CalculateType(Enum):
    REQUIRE = 1
    REQUIRE_SUMMARY = 2
    ORDER_PLAN = 3


"""
缓存类型
"""
class CacheType(Enum):
    BOM = 1
    PRODUCE_SPEED = 2
    PRODUCE_QUEUE = 3
    PARTS = 4
    PARTS_LOAD_DELAY_TIME = 5
    INVENTORY = 6
    SHIPPER = 7
    OPERATION_TIME = 8
    FACTORY_TRANSPORT_TIME = 9
    SUPPLIER_DISTANCE = 10
    SUPPLIER_DURATION = 11
    SUPPLIER = 12
    REQUIRE = 13
    REQUIRE_SUMMARY = 14
    ORDER_PLAN = 15


"""
上传校验类型
"""
class UploadValidateType(Enum):
    NOT_EMPTY = 1
    IS_NUMBER = 2
    CONTAIN_STRING = 3
    DATETIME = 4